float radial(vector uv, float offset, float repeat)
 {
    float a = mod((atan2(uv[1], uv[0]) + M_PI + (offset * 2.0 * M_PI)) * 5.0 / M_PI, 2.0);
    return (a > 1.0) ? 2.0 - a : a;
}

shader Add
(
		float iTime=0,
    output color col = 0
    )
{
		vector uv = 12*vector(u,v,0);
		
		float d = length(uv) - 0.1;
		float off = length(uv);
		float a = radial(uv, sin(off*2.0-iTime*2.0) / 2.0, 3.0) - 0.5;
		d = a;
	
    
    //float m = d < 0.0 ? 0.0 : 1.0;
    float m = clamp(-d*6.0, 0.0, 1.0);
    
    col = mix(vector(1.0, 0.2, 0.4), vector(1.0, 1.0, 0.4), m);
    col *= sin(off * 4.0 - iTime*4.0) / 5.0 + 0.7;
    
}